package cn.ios.hrm.feign;

import cn.ios.hrm.domain.LoginUser;
import cn.ios.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class LoginUserFallbackFactory implements FallbackFactory<ILoginUserFeignClient> {

    @Override
    public ILoginUserFeignClient create(Throwable throwable) {
        return new ILoginUserFeignClient() {
            @Override
            public AjaxResult TenantEntering(LoginUser loginUser) {
                return AjaxResult.me().setSuccess(false).setMessage("骚瑞，入驻异常，请稍后重试");
            }
        };
    }
}
